package com.syq.controller;

import com.syq.annotation.RequiresPermissionsDesc;
import com.syq.service.DtsBrandService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName: AdminBrandController
 * @Description: TODO
 * @Create by: syq
 * @Date: 2022/7/28 9:10
 */

@RestController
@RequestMapping("/admin/brand")
@CrossOrigin
public class AdminBrandController {

    @Autowired
    private DtsBrandService dtsBrandService;

    @RequiresPermissionsDesc(menu = {"商场管理","品牌商"},button = "查询")
    @RequiresPermissions(value = "admin:brand:list")
    @GetMapping("/list")
    public Object list(@RequestParam(defaultValue = "1")Integer page,
                       @RequestParam(defaultValue = "10")Integer limit,
                       @RequestParam(defaultValue = "add_time")String sort,
                       @RequestParam(defaultValue = "desc")String order,String name,Integer id){
        return dtsBrandService.findAll(page,limit,sort,order,name,id);
    }

    @GetMapping("/catAndAdmin")
    public Object catAndAdmin(){
       return dtsBrandService.catAndAdmin();
    }
}
